package com.lwj.liwanjia.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;

import com.lwj.liwanjia.R;
import com.superrecycleview.superlibrary.adapter.BaseViewHolder;
import com.superrecycleview.superlibrary.adapter.SuperBaseAdapter;

import java.util.List;

/**
 * Created by Administrator on 2017/9/16.
 */

public class YizhanAdapter extends SuperBaseAdapter<String> {
    private int checkPosition;

    public void setCheckPosition(int checkPosition) {
        this.checkPosition = checkPosition;
    }

    public YizhanAdapter(Context context, List<String> data) {
        super(context, data);
    }

    @Override
    protected void convert(BaseViewHolder holder, String item, int position) {
        ImageView ivXuanze = holder.getView(R.id.iv_xuanze);
        if (checkPosition == position) {
            ivXuanze.setImageResource(R.mipmap.kuang_1);
        } else {
            ivXuanze.setImageResource(R.mipmap.kuang);
        }
    }

    @Override
    protected int getItemViewLayoutId(int position, String item) {
        return R.layout.yizhan_item;
    }
}
